package com.how2java.tmall.service;

import com.how2java.tmall.dao.DepositDAO;
import com.how2java.tmall.pojo.Deposit;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Slf4j
@Service
public class DepositService {
    @Autowired
    DepositDAO depositDAO;

    public void add(Deposit deposit) {
        depositDAO.save(deposit);
    }
    public void delete(Integer deposit_Id){
        depositDAO.deleteById(deposit_Id);
    }

    public void update(Deposit bean){
        depositDAO.save(bean);
    }

    public Deposit get(int deposit_id){
        return  depositDAO.getOne(deposit_id);
    }

}
